package com.qidian.mes.cal.service.Impl;

import com.qidian.mes.cal.mapper.CalShiftMapper;
import com.qidian.mes.cal.service.CalShiftService;
import com.qidian.mes.pojo.CalShift;
import com.qidian.mes.util.pojo.MESResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CalShiftServiceImpl implements CalShiftService {
    @Autowired
    CalShiftMapper calShiftMapper;

    @Override
    //删除班次信息
    public MESResult deletes(Long[] shiftIds) {
        return MESResult.ok(calShiftMapper.deletes(shiftIds));
    }

    @Override
    //修改信息
    public MESResult update(CalShift calShift) {
        return MESResult.ok(calShiftMapper.update(calShift));
    }

    @Override
    //根据Id查询班次信息
    public MESResult get(Long shiftId) {
        return MESResult.ok(calShiftMapper.get(shiftId));
    }

    @Override
    //添加计划
    public MESResult save(CalShift calShift) {
        return MESResult.ok(calShiftMapper.save(calShift));
    }

    @Override
    //查询班次信息
    public MESResult list(Long planId) {
        return MESResult.ok(calShiftMapper.list(planId));
    }
}
